home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / svgabg55 / faq.doc < prev    next >
Text File  |  1994-08-23  |  5KB  |  89 lines

  1.  
  2.  ---------------------------------------------------------------------------
  3.   Q: Why doesn't the mouse cursor show up when I try to display it?
  4.  
  5.   A: Most mouse drivers don't recognize video modes other than standard
  6.      VGA, so they don't know how to display the cursor in those modes.
  7.      Some newer mouse drivers, such as Microsoft's and Logitech's,
  8.      have an overlay which knows how to draw the cursor in VESA modes.
  9.      However, there are no current mouse drivers that have support for 
  10.      tweaked modes or other non-VESA video modes.
  11.  
  12.   Fix:
  13.      The HGXMOUSE TSR/LIB will handle cursor drawing automatically in all 
  14.      the modes the BGI drivers support, so if you load it before your 
  15.      program starts, the mouse cursor will be visible.
  16.  
  17.  ---------------------------------------------------------------------------
  18.   Q: Why isn't anything showing up on the screen when I start drawing
  19.      after initgraph?
  20.  
  21.   A: The BGI kernel by default sets the initial color to the max color
  22.      supported.  In 16 color modes, this is fine, since the max color
  23.      also happens to be white.  In 256 color modes, the max color is 
  24.      255, which in the default palette is black.  You must do a setcolor(15)
  25.      before drawing.  In the hi/true color modes, the setrgbpalette 
  26.      interface must be used to set the current colors, so initialize
  27.      the current color to white using RealDrawColor.
  28.  
  29.  ---------------------------------------------------------------------------
  30.   Q: Why can't I link the BGI driver into my program?
  31.  
  32.   A: register{far}bgidriver() may function differently depending on which 
  33.      version and language Borland compiler you have.  The easiest way to 
  34.      get the drivers to link properly is to fool the BGI kernel into thinking 
  35.      that the BGI driver is one of the Borland-supplied drivers.  Every BGI 
  36.      file has an ID string near offset hex 8A in the BGI header.  If this 
  37.      string is changed to EGAVGA before the driver is linked in, then 
  38.      register{far}bgidriver and initgraph will work successfully.  This
  39.      ID string is a Pascal string, with the length field before it, so don't
  40.      forget to modify this byte too.
  41.  
  42.   Example:
  43.    c:\svga> debug svga256.bgi
  44.    -d180 l 20
  45.    0D74:0180  A0 00 00 00 5C 22 02 00-01 00 07 53 56 47 41 32   ....\".....SVGA2
  46.    0D74:0190  35 36 00 00 00 00 00 00-00 00 00 00 00 00 00 00   56..............
  47.    -a18a
  48.    { Note: For the protected mode driver, the offset is 18E }
  49.    0D74:018A db 6,'EGAVGA',0
  50.    0D74:0192 
  51.    -d180 l 20
  52.    0D74:0180  A0 00 00 00 5C 22 02 00-01 00 06 45 47 41 56 47   ....\".....EGAVG
  53.    0D74:0190  41 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   A...............
  54.    -w
  55.    -q
  56.  
  57.  ---------------------------------------------------------------------------
  58.   Q: Why do I get an 'invalid device driver file' when I run my program?
  59.  
  60.   A: You are probably using Turbo/Borland Pascal 7.0 in protected mode
  61.      with a BGI v2.0 file.  TC++/BC++ and TP/BP in real mode need a
  62.      BGI version 2.0 file.  In protected mode, BP/TP 7.0 need a BGI
  63.      version 3.0 file.  BGI v2.0 and BGIv3.0 drivers are not compatible
  64.      with each other.  The normal v2.0 drivers are located in the main
  65.      source directory, the protected mode drivers are in the BGI30 directory.
  66.  
  67.  ---------------------------------------------------------------------------
  68.   Q: Why doesn't imagesize return the correct value?
  69.  
  70.   A: The imagesize() function doesn't call the BGI drivers to calculate the
  71.      size of an image.  It also won't return a value >64k.  The correct
  72.      size calculation for the different drivers is:
  73.  
  74.     Svga16,Twk16    : imsize = 4+(((long)xwid >> 1)+1)*ywid;
  75.     Svga256,Twk256  : imsize = 4+((long)xwid)*ywid;
  76.     Svga32k/Svga64k : imsize = 4+((long)xwid << 1)*ywid;
  77.      SvgaTC          : imsize = 4+((long)xwid << 2)*ywid;
  78.  
  79.  ---------------------------------------------------------------------------
  80.   Q: Why does initgraph return error 246?
  81.  
  82.   A: The BGI driver returns an 8-bit signed value to the BGI kernel.  The
  83.      BGI kernel zero extends this value, instead of sign extending it, so
  84.      the value it is returning is actually 246 instead of -10, which is
  85.      grModeNotSup (mode not supported).  This means that your video card
  86.      does not support that particular mode.  If no extended modes work
  87.      on your card, either your card is not supported or it is not getting
  88.      detected properly.
  89.